//
//  Loading.m
//  J加载动画
//
//  Created by dllo on 15/11/16.
//  Copyright © 2015年 YingKang. All rights reserved.
//

#import "Loading.h"
#import "FitHeader.h"
@implementation Loading
-(instancetype)initWithFrame:(CGRect)frame PicArray:(NSMutableArray *)picArray
{
    self = [super initWithFrame:frame];
    if (self) {
        _backView = [[UIView alloc]initWithFrame:frame];
        _backView.backgroundColor = [UIColor whiteColor];
        
        _array = [NSMutableArray array];
        _loadingImageView = [[UIImageView alloc]initWithFrame:CGRectMake(62.5 * wt, 150 * ht, 250 * wt, 200 * ht)];
        NSInteger count = picArray.count;
        for (NSInteger i = 0; i < count; i++) {
        UIImage *loadingImage = [UIImage imageNamed:picArray[i]];
            [_array addObject:loadingImage];
        }
      
        _loadingImageView.animationImages = _array;
        _loadingImageView.animationDuration = 1.5;
        [_loadingImageView startAnimating];
        [_backView addSubview:_loadingImageView];
        [self addSubview:_backView];
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
